package com.ejuornal.util;

import java.io.IOException; 
 

import javax.servlet.FilterChain;  
import javax.servlet.ServletException;  
import javax.servlet.ServletRequest;  
import javax.servlet.ServletResponse;  
import javax.servlet.http.HttpServletRequest;  
  
import org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter;  
  
/** 
 *  
 * 解决图片上传bug的struts过滤器 
 * 
 */  
public class ckeditor extends StrutsPrepareAndExecuteFilter {  
  
    @Override  
    public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain chain) throws IOException, ServletException {  
        HttpServletRequest request = (HttpServletRequest) arg0;  
        String uri = request.getRequestURI();  
        if(uri.endsWith("/ckfinder/core/connector/java/connector.java")){//其他在线编辑器也可能存在此情况，依此方法解决  
            chain.doFilter(arg0, arg1);  
        }else{  
            super.doFilter(arg0, arg1, chain);  
        }  
    }  
  
      
}  